package cn.cvs.service.impl;

import org.apache.log4j.Logger;
import org.aspectj.lang.JoinPoint;

import java.util.Arrays;

public class UserServiceLoggerImpl {
    private static final Logger log = Logger.getLogger(UserServiceLoggerImpl.class);

    /**
     * 前置增强代码
     */
    public void before(JoinPoint joinPoint){
        log.info("调用"+joinPoint.getTarget()+"的"+joinPoint.getSignature().getName()+"方法.方法入参"
                + Arrays.toString(joinPoint.getArgs()));
    }


    public void afterReturning(JoinPoint joinPoint,Object result){
        log.info("调用"+joinPoint.getTarget()+"的"+joinPoint.getSignature().getName()+"方法.方法返回值"
        +result);
    }
    /**
     * 后置增强代码
     */
}
